<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 梁家源
  Date: 2021/4/6
  Time: 19:31
  To change this template use File | Settings | File Templates.
    !!!本页面为测试页面，仅供操作展示用，非正式发布用页面!!!
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>后台总控制台</title>
    <!-- layUI的核心CSS文件 -->
    <link rel="stylesheet" type="text/css"
          href="${pageContext.request.contextPath}/static/layui-v2.5.7/layui/css/layui.css"/>
    <!-- layUI的核心JS文件 -->
    <script src="${pageContext.request.contextPath}/static/layui-v2.5.7/layui/layui.js" type="text/javascript"
            charset="UTF-8"></script>
    <script src="${pageContext.request.contextPath}/static/script/jquery-1.7.2.js" type="text/javascript"
            charset="UTF-8"></script>
</head>
<body class="layui-layout-body close-footer">
<script>
    //JavaScript代码区域
    layui.use('element', function () {
        var element = layui.element;
    });

    layui.use('form', function () {
        var form = layui.form;
    });

    //通过iframe局部刷新页面
    $(document).ready(function(){
        $("#jump").bind('click', function(){
            $("#consoleContent").attr("src", $(this).attr("href"));
        });
    });

    let manage = document.getElementById("manager");
    let data_statistics=document.getElementById("dataStat");
    // btn表示侧边栏的按钮
    let btns = document.getElementsByName("leftBtn");
    for(let i=0;i<btns.length;i++){
        btns[i].onclick = function(){
            alert("测试");
            manage.classList.add('layui-this');
            data_statistics.classList.remove('layui-this');
        };
    }



</script>
<!-- 管理员登录状态下的头部导航栏 -->
<div class="layui-layout layui-layout-admin">
    <div class="layui-header ">
        <!-- 头部区域（可配合layui已有的水平导航） -->
        <div class="layui-logo"><a href="ShowALLGoods" style="color: #009688;">龙洞闲置购物系统</a></div>
        <ul class="layui-nav layui-layout-left ">
            <li id="manager" class="layui-nav-item " style="user-select: none">
                <a  href="${pageContext.request.contextPath}/showConsoleHomePage" target="adminFrame">后台首页</a>
            </li>
            <li id="dataStat" class="layui-nav-item " style="user-select: none">
                <a  href="${pageContext.request.contextPath}/showConsoleData" target="adminFrame">
                    数据统计
                </a>
            </li>

        </ul>
        <ul class="layui-nav layui-layout-right " lay-filter="layadmin-layout-right">
            <!-- 如果管理员已登录 -->
            <li class="layui-nav-item">
                <a href="javascript:;">
                    <c:if test="${empty sessionScope.admin.aheadsrc}">
                        <img src="${pageContext.request.contextPath}/static/images/default_head.jpg"
                             class="layui-nav-img"
                            <%--                         style="width: 50px; height: 50px;margin-left: 15px;"--%>
                        >
                        管理员${sessionScope.admin.aname}
                    </c:if>
                    <c:if test="${not empty sessionScope.admin.aheadsrc}">
                        <img src="${admin.aheadsrc}" class="layui-nav-img"
                            <%--                         style="width: 50px; height: 50px;margin-left: 15px;"--%>
                        >
                        管理员${sessionScope.admin.aname}
                    </c:if>
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="${pageContext.request.contextPath}/readAdminInfo">
                        <i class="layui-icon">&#xe68e;</i>&nbsp;我的信息</a>
                    </dd>
                    <dd><a href="${pageContext.request.contextPath}/toAdminPasswordPage">
                        <i class="layui-icon">&#xe683;</i>&nbsp;安全设置</a>
                    </dd>
<%--                    <dd><a href="ShowALLGoods">--%>
<%--                        <i class="layui-icon">&#xe665;</i>&nbsp;商城首页</a>--%>
<%--                    </dd>--%>
                    <dd><a href="${pageContext.request.contextPath}/adminLoginOut">
                        <i class="layui-icon">&#xe682;</i>&nbsp;退出登录</a>
                    </dd>
                </dl>
            </li>
        </ul>
    </div>


    <%--侧边导航栏--%>
    <div class="layui-side layui-bg-black" >
        <div class="layui-side-scroll">
            <div class="layui-logo"><a style="color: #009688;">占位置的（不显示）</a></div>
            <ul class="layui-nav layui-nav-tree" id=" " lay-filter=" ">
                <li  class="layui-nav-item">
                    <a name="leftBtn" href="javascript:;" >
                        <i class="layui-icon">&#xe770;</i>&nbsp;&nbsp;人员管理
                    </a>
                    <dl class="layui-nav-child">
                        <dd><a href="${pageContext.request.contextPath}/readAllUser" target="adminFrame">会员管理</a></dd>
                        <dd><a href="${pageContext.request.contextPath}/showAllGeneralAdmins" target="adminFrame">管理员管理</a></dd>
                    </dl>
                </li>
                <li name="leftBtn" class="layui-nav-item">
                    <a href="${pageContext.request.contextPath}/showAllOrder" target="adminFrame">
                        <i class="layui-icon">&#xe63c;</i>&nbsp;&nbsp;订单管理
                    </a>
                </li>
                <li name="leftBtn" class="layui-nav-item">
                    <a href="${pageContext.request.contextPath}/queryAllCategory" target="adminFrame">
                        <i class="layui-icon">&#xe653;</i>&nbsp;&nbsp;类别管理
                    </a>
                </li>
                <li name="leftBtn" class="layui-nav-item layui-nav-itemed">
                    <a href="${pageContext.request.contextPath}/showAllTOGoods" target="adminFrame">
                        <i class="layui-icon">&#xe6b2;</i>&nbsp;&nbsp;商品举报
                    </a>
                </li>
                <li name="leftBtn" class="layui-nav-item layui-nav-itemed">
                    <a href="${pageContext.request.contextPath}/showAllOffShelfGoods" target="adminFrame">
                        <i class="layui-icon">&#xe64f;</i>&nbsp;&nbsp;下架管理
                    </a>
                </li>

            </ul>
        </div>
    </div>
    <%--主体内容--%>
    <div class="layui-body close-footer" id="">
        <iframe id="consoleContent" name="adminFrame" src="${pageContext.request.contextPath}/showConsoleHomePage" style="width: 100%;height: 99%">
        </iframe>
    </div>


</div>



</body>
</html>
